import java.util.Arrays;
import java.util.List;


public class ClearWarning {
	public <T> T[] listToArray(List<T> list, T[] a) {
		int size = list.size();
		if(a.length < size) {
			return (T[]) Arrays.copyOf(list.toArray(), size, a.getClass());
		}
		System.arraycopy(list.toArray(), 0, a, 0, size);
		if(a.length > size) {
			a[list.size()] = null;
		}
		return a;
	}
	public static void main(String[] args) {
		
	}

}
